function registerHelper() {
    Handlebars.registerHelper('trimNumber', function(num) {
        if ($.isNumeric(num)) {
            num = parseFloat(num).toFixed(2);
        }
        return new Handlebars.SafeString(num);
    });

    Handlebars.registerHelper('rowStatus', function(row) {
        var status = "";
        if (row !== undefined) {
            if (row.running === '1') {
                status = row.dangerous === '1' ? 'rfire' : 'rball';
            } else {
                status = row.won === '1' ? 'victory' : 'failed';
                if (row.dangerous === '1')
                    status += ' fire';
            }
        }
        return new Handlebars.SafeString(status);
    });

    Handlebars.registerHelper("compare", function(v1, op, v2, options) {

        var c = {
            "eq": function(v1, v2) {
                return v1 === v2;
            },
            "neq": function(v1, v2) {
                return v1 !== v2;
            }
        }

        if (Object.prototype.hasOwnProperty.call(c, op)) {
            return c[ op ].call(this, v1, v2) ? options.fn(this) : options.inverse(this);
        }
        return options.inverse(this);
    });
}